Skip to content

fix: free overflow-page chains on DROP TABLE/DROP INDEX - #611

Merged
iheitlager merged 2 commits into
mainfrom
fix/btree-overflow-leak-on-drop
Aug 27, 2026
Merged

fix: free overflow-page chains on DROP TABLE/DROP INDEX#611
iheitlager merged 2 commits into
mainfrom
fix/btree-overflow-leak-on-drop

Conversation

@iheitlager

Copy link
Copy Markdown
Member

Summary

  • free_btree_pages_inner walked and freed a b-tree's leaf/interior pages but not the overflow-page chains hanging off individual cells, leaking those pages instead of returning them to the freelist.
  • Table leaf, index leaf, and index interior cells now have their first overflow page located (first_overflow_page) and their whole chain walked and deallocated (free_overflow_chain, mirroring reassemble_payload's cycle-safe walk) before the tree structure itself is freed.

Test plan

  • New regression test free_btree_pages_reclaims_overflow_chain_pages (verified it fails without the fix — leaked 7/8 pages — and passes with it)
  • cargo test --lib (925 tests), corpus btree/drop tests, clippy, make assurance all clean

spend: within trivial-fix budget (single-file change + regression test)

🤖 Generated with Claude Code

free_btree_pages_inner walked and freed a b-tree's leaf/interior pages
but not the overflow-page chains hanging off individual cells, leaking
those pages instead of returning them to the freelist. Table leaf,
index leaf, and index interior cells now have their first overflow
page located (first_overflow_page) and their whole chain walked and
deallocated (free_overflow_chain, mirroring reassemble_payload's
cycle-safe walk) before the tree structure itself is freed.

spend: within trivial-fix budget (single-file change + regression test)
@iheitlager
iheitlager force-pushed the fix/btree-overflow-leak-on-drop branch from 5f21928 to 86238e6 Compare August 27, 2026 20:58
@iheitlager
iheitlager merged commit 92f2e37 into main Aug 27, 2026
5 checks passed
@iheitlager
iheitlager deleted the fix/btree-overflow-leak-on-drop branch August 27, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant